import { RouteRecordRaw}  from "vue-router";

//一级路由可以防止白屏
import Login from "@/views/login/index.vue"
//模块路由
import systemRoutes from "./module/system";
import notFound from "./module/notFound";

const routes: RouteRecordRaw[] = [
    {
        path: "/",
        redirect: '/login'
    },
    {
        path: "/login",
        name: "login",
        component: Login
    },
    {
        path: "/homePage",
        name: "homePage",
        component: () => import("@/views/homePage/index.vue"),
        children: [
            {
                path: "/home",
                name: "home",
                component: () => import("@/views/home/index.vue"),
                meta: { title: "首页" }
            },
            //模块路由
            ...systemRoutes,
        ]
    },
    //404
    ...notFound
];

export default routes;